<%@ page import="com.zs.dao.AdminDao" %>
<%@ page import="com.zs.entity.Admin" %><%--
  Created by IntelliJ IDEA.
  User: chongge
  Date: 2024/1/11
  Time: 18:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%
        int id = Integer.parseInt(request.getParameter("id"));
        String aname = request.getParameter("aname");
        String apwd = request.getParameter("apwd");
        String phone = request.getParameter("phone");
        String email = request.getParameter("email");
        AdminDao adminDao = new AdminDao();
        Admin admin = new Admin(id,aname,apwd,phone,email);
        boolean result =  adminDao.updateAdmin(admin);
        if (result){
            response.sendRedirect("adminManage.jsp");
        }else{
            response.sendRedirect("adminUpdate.jsp");
        }

    %>
</body>
</html>
